package com.xx.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.Version;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

public class BaseEntity implements Serializable {
    @Serial
    private static final long serialVersionUID = 2723972486979294419L;
    /**
     * 创建时间
     */
    @TableField(value = "created_at",fill = FieldFill.INSERT )
    private LocalDateTime createdAt;

    /**
     * 修改时间
     */
    @TableField( value = "updated_at",fill = FieldFill.UPDATE)
    private LocalDateTime updatedAt;

    /**
     * 删除时间
     */
    @TableField("deleted_at")
    private Date deletedAt;

    /**
     * 版本
     */
    @Version
    @TableField(value = "version",fill = FieldFill.INSERT)
    private Integer version;
}
